package com.kgc.skProvider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.collection.remote.SalesAdvanceRemote;
import com.kgc.skProvider.service.SalesAdvanceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.Map;

@Controller
public class SalesAdvanceController implements SalesAdvanceRemote {

    private Logger logger= LoggerFactory.getLogger(getClass());

    @Autowired
    private SalesAdvanceService salesAdvanceService;


    @Override
    public ResponseMsg selectSalesAdvanceByPage(Map<String, Object> map) {
        logger.info("SalesAdvanceController selectSalesAdvanceByPage params is{}",map.toString());
        ResponseMsg responseMsg=salesAdvanceService.selectSalesAdvanceByPage(map);
        logger.debug("SalesAdvanceController selectSalesAdvanceByPage response is{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg updateSalesAdvance(Map<String, Object> map) {
        logger.info("SalesAdvanceController updateSalesAdvance params is{}",map.toString());
        ResponseMsg responseMsg=salesAdvanceService.updateSalesAdvance(map);
        logger.debug("SalesAdvanceController updateSalesAdvance response is{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg insertSalesAdvance(Map<String, Object> map) {
        logger.info("SalesAdvanceController insertSalesAdvance params is{}",map.toString());
        ResponseMsg responseMsg=salesAdvanceService.insertSalesAdvance(map);
        logger.debug("SalesAdvanceController insertSalesAdvance response is{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg deleteSalesAdvance(Map<String, Object> map) {
        logger.info("SalesAdvanceController deleteSalesAdvance params is{}",map.toString());
        ResponseMsg responseMsg=salesAdvanceService.deleteSalesAdvance(map);
        logger.debug("SalesAdvanceController deleteSalesAdvance response is{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg checkSalesAdvance(Map<String, Object> map) {
        logger.info("SalesAdvanceController checkSalesAdvance params is{}",map.toString());
        ResponseMsg responseMsg=salesAdvanceService.checkSalesAdvance(map);
        logger.debug("SalesAdvanceController checkSalesAdvance response is{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg selectSalesAdvanceByCode(Map<String, Object> map) {
        logger.info("SalesAdvanceController selectSalesAdvanceByCode params is{}",map.toString());
        ResponseMsg responseMsg =salesAdvanceService.selectSalesAdvanceByCode(map);
        logger.debug("SalesAdvanceController selectSalesAdvanceByCode response is{}",responseMsg);
        return responseMsg;
    }
}
